package com.yunfangdata.service.impl;


import com.yunfangdata.domain.SystemMenu;
import com.yunfangdata.mapper.SystemMenuMapper;
import com.yunfangdata.service.ISystemMenuService;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SystemMenuServiceImpl implements ISystemMenuService {


    @Autowired
    private SystemMenuMapper mapper;

    public void save(SystemMenu entity) {
        mapper.insert(entity);
    }

    public void delete(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void update(SystemMenu entity) {
        mapper.updateByPrimaryKey(entity);
    }

    public SystemMenu get(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

    public List<SystemMenu> list() {
        return mapper.selectAll();
    }

    public List<SystemMenu> listRootMenu() {
        return mapper.listRootMenu();
    }
}
